Overview of Sattolo ’ s Algorithm

نویسندگان

  • Mark C. Wilson
  • Éric Fusy
چکیده

We give an overview of Sattolo’s algorithm, which allows to perform random generation of a cyclic permutation of a fixed number of elements. In Section 1, we describe the algorithm and prove its correctness by using a recursive proof which parallelizes the recursive structure of the algorithm. The recursive structure also allows to analyze two simple parameters associated to the algorithm. As we see in Section 2, simple recursive equations have been obtained by Prodinger and then studied by Mahmoud to obtain convergence results of the distribution of these parameters. In Section 3, we present the method exposed by Mark C. Wilson in his talk to deal with the analysis of parameters associated to the algorithm. He uses a “grand” generating function F (t, u, x) associated to each parameter and tries to obtain an explicit expression for this function. He only partially succeeds and finds an explicit expression for ∂ ∂x F (t,u,x) x , from which Prodinger’s and Mahmoud’s results can be retrieved. 1. Sattolo’s Algorithm 1.1. Description. In [4], Sattolo presents a very simple algorithm to uniformly sample a cyclic permutation σ of n elements. The algorithm starts with the identity permutation σ(0) = Id. For each i ∈ {1, . . . , n − 1}, we denote by σ(i) the permutation obtained after the i first steps. Step i consists in choosing a random integer ki in {1, . . . , n − i} and swapping the values of σ(i−1) at places ki and n − i + 1. In this way, we obtain a new permutation σ(i), which is equal to σ(i−1) ◦ τki,n−i+1, where τki,n−i+1 is the transposition exchanging ki and n− i+ 1. Finally, the algorithm returns the permutation σ = σ(n−1). An example of the execution of the algorithm is illustrated on Figure 1, where n = 5 and the sequence of chosen random integers is 3, 1, 2, 1. The returned cyclic permutation on this example is 1→ 5→ 3→ 2→ 4→ 1. Sattolo’s algorithm is the adaptation for cyclic permutations of a very well known algorithm [1] to sample a permutation of n elements at random. The only difference is that Sattolo’s algorithm chooses the random integer ki in {1, . . . , n − i} whereas the algorithm of [1] chooses ki randomly in {1, . . . , n− i+ 1} at step i. 1.2. Correctness. The fact that the algorithm returns a uniformly distributed random cyclic permutation follows from the unicity and existence of the decomposition of a cyclic permutation σ as a product τk1,n ◦ · · · ◦ τki,n−i+1 ◦ · · · ◦ τkn−1,2, where ki ∈ {1, . . . , n− i} for 1 ≤ i ≤ n− 1. 106 Overview of Sattolo’s Algorithm 1 2 3 4 5 1 2 5 4 3 4 2 5 1 3 4 5 2 1 3 5 4 2 1 3 Figure 1. The execution of Sattolo’s algorithm for n = 5, and when the sequence of chosen random swapping places is 3, 1, 2, 1. This property can be established recursively by associating to σ the number q(σ) = σ(n). As σ is cyclic, q(σ) ∈ {1, . . . n− 1}. In addition τq(σ),n ◦ σ fixes n and is cyclic on {1, . . . , n− 1}: indeed, with the cyclic notation, if σ = (n, q(σ), r1, . . . , rn−3), then τq(σ),n ◦ σ = (n)(q(σ), r1, . . . , rn−3). Notation. We denote the permutation τq(σ),n ◦ σ by σ↓. 2. Analysis of the Algorithm: Probabilistic Approaches In the literature, two parameters are analyzed: the number of times a value k is moved is denoted by Mn,k and the total distance covered by a value k is denoted by Dn,k. For example, on Figure 1, the values of Mn,k are 1, 1, 1, 2, 3 and the values of Dn,k are 3, 1, 2, 4, 4 for k = 1, 2, 3, 4, 5. 2.1. Prodinger’s approach. In [3], Prodinger introduces the probabilistic generating function φn,k(u) = ∑ l P (Mn,k = l)u l associated to the parameter Mn,k and the probabilistic generating function ξn,k(u) = ∑ l P (Dn,k = l)u l associated to the parameter Dn,k. Using the recursive structure of the algorithm, he obtains a recursive system of two equations for φn,k(u): (1) { φn,k(u) = n−k n−1u+ k−1 n−1φk,k(u) 1 ≤ k < n φn,n(u) = u n−1 ∑n−1 k=1 φn−1,k(u) n ≥ 2, φ1,1(u) = 1 We note En,k = E(Mn,k). Observing that En,k = φn,k(1) and derivating Equation-system 1 at u = 1, we find the following recursive system: (2) { En,k = n−k n−1 + k−1 n−1Ek,k En,n = 1 + 1 n−1 ∑n−1 k=1 En−1,k From this system, it is easy to deduce an explicit expression for E(Mn,k): (3) E(Mn,k) = n+ 2k − 5 n− 1 k ≥ 2, E(Mn,1) = 1 n ≥ 2, E(M1,1) = 0 Similarly, we can find an explicit expression for Var(Mn,k): (4) Var(Mn,k) = 2(k − 2)(3n+ 1− 2k) (n− 1)2 − 4Hk−2 n− 1 k ≥ 2, Var(Mn,1) = 0 M. C. Wilson, summary by É. Fusy 107 For the parameter Dn,k, the recursive structure of the algorithm yields: (5) { ξn,k(u) = u n−k n−1 + n−2 n−1ξn−1,k(u), 1 ≤ k < n ξn,n(u) = 1 n−1 ∑n−1 k=1 ξn−1,k(u)u n−k n ≥ 2, ξ1,1(u) = 1 From these equations, we can also obtain an exact expression for the mean and variance of the variable Dn,k. 2.2. Mahmoud’s refinements. In [2], Mahmoud considers the “randomized” variable Mn,Kn where Kn is a random element uniformly chosen in {1, . . . , n}. Writing ψn(u) = E(uMn,Kn ) for its probabilistic generating function, he obtains from Equation-system 1 the simple recursive equation ψn(u) = n−2+u n ψn−1(u) + u n . Hence ψn(u)− u 2−u = n−2+u n ( ψn−1(u)− u 2−u ) . As a consequence, he obtains (6) ψn(u) = u 2− u ( 1− 2Γ(n− u+ 1) uΓ(u− 1)Γ(n+ 1) ) Thus, for 0 ≤ u < 2 and according to Stirling formula, ψn(u) →n→∞ 12 u 1−u/2 , which is the probabilistic generating function of a geometric random variable Geo(1/2). As a consequence, Mn,Kn converges in distribution to Geo(1/2), a result which can be intuitively predicted from the recursive structure of the algorithm. Then Mahmoud “derandomizes” Mn,Kn , using the equation φn,k(u) = n−k n−1u + k−1 n−1uψk(u). He finds an explicit limit φα(u) for φn,k(u) when k n →n→∞ α, such that φα(u) is the probabilistic generating function of a random variable Xα = B + (1−B)(1 +Geo( 2)) where B has law Ber(α). Hence, when k n →n→∞ α, Mn,k converges in distribution to a mixture of the constant 1 and of the random variable 1+Geo(12), where the random variable mixing the two variables is a Bernoulli law Ber(α) with rate α. The mean and variance of this random variable agree with the limit of the exact expressions of Prodinger for E(Mn,k) and Var(Mn,k) when k n →n→∞ α. Similarly, Mahmoud randomizes the problem for ξn,k. He considers the random variable Dn,Kn , where Kn is an integer uniformly distributed in {1, . . . , n}. A scaling is necessary to obtain a convergence result. We have to consider the variable D̃n,Kn = 1 n(Dn,Kn−Kn). Writing η̃(u) for the probabilistic generating function of D̃n,Kn , Mahmoud finds that η̃(e)→n→∞ ∫ 1 0 eθt−e−θt 2θt dθ. Hence, D̃n,Kn converges in distribution to a product of two independant uniform U(0, 1) and U(−1, 1) random variables, a less intuitive result than for the case of Mn,Kn . 3. The Method of Mark Wilson 3.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Probability Generating Functions for Sattolo’s Algorithm

In 1986 S. Sattolo introduced a simple algorithm for uniform random generation of cyclic permutations on a fixed number of symbols. Recently, H. Prodinger analysed two important random variables associated with the algorithm, and found their mean and variance. H. Mahmoud extended Prodinger’s analysis by finding limit laws for the same two random variables.The present article, starting from the ...

متن کامل

Random and exhaustive generation of permutations and cycles

In 1986 S. Sattolo introduced a simple algorithm for uniform random generation of cyclic permutations on a fixed number of symbols. This algorithm is very similar to the standard method for generating a random permutation, but is less well known. We consider both methods in a unified way, and discuss their relation with exhaustive generation methods. We analyse several random variables associat...

متن کامل

Probability generating functions for Sattolo’s algorithm

In 1986 S. Sattolo introduced a simple algorithm for uniform random generation of cyclic permutations on a fixed number of symbols. Recently, H. Prodinger analysed two important random variables associated with the algorithm, and found their mean and variance. Mahmoud extended Prodinger’s analysis by finding limit laws for the same two random variables. The present article, starting from the de...

متن کامل

Planning in a cross dock network with an operational scheduling overview

Nowadays, cross docking plays an important role in the supply chain networks especially in transportation systems. According to the cross dock system advantages such as reducing transportation costs, lead times, and inventories, scheduling in a cross-dock center would be more complicated by increasing the number of suppliers, customers and product types. Considering the cross dock limited capac...

متن کامل

An Overview of Group Key Management Issues in IEEE 802.16e Networks

The computer industry has defined the IEEE 802.16 family of standards that will enable mobile devices to access a broadband network as an alternative to digital subscriber line technology. As the mobile devices join and leave a network, security measures must be taken to ensure the safety of the network against unauthorized usage by encryption and group key management. IEEE 802.16e uses Multica...

متن کامل

An Overview of Vocabulary Learning Strategies in English as a Foreign Language

Researchers in the area of EFL learning have tried to put the way(s) by which EFL learners learnEnglish vocabulary into some frames and present them as strategies. This paper reviewsdescriptive research on vocabulary learning strategies in English as a foreign language. Thereview focuses on common strategies that learners use in vocabulary learning such as dictionarystrategies, note-taking stra...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004